<template>
  <div>
    <UploadExcel :on-success="handleSuccess"></UploadExcel>
  </div>
</template>

<script>
export default {
  name: "",
  data() {
    return {};
  },
  created() {},
  mounted() {},
  computed: {},
  components: {},
  methods: {
    handleSuccess({ header, results }) {
      const userRelations = {
        入职日期: "timeOfEntry",
        手机号: "mobile",
        姓名: "username",
        转正日期: "correctionTime",
        工号: "workNumber"
      };
      let arr = [];
      results.forEach(t => {
        let item = {};
        for (const key in t) {
          let value = t[key];
          let newKey = userRelations[key];
          item[newKey] = value;
        }
        arr.push(item);
      });
      console.log(arr);
    }
  }
};
</script>

<style lang="less" scoped>
</style>